<template>
  <div class="insertAudio-content">
    <el-input type="textarea" class="padding10" v-model="insertAudioContent" :autosize="{ minRows: 10, maxRows: 30 }"
      placeholder="请输入插播音频">
    </el-input>
    <div class="oper">
      <el-button type="primary" @click="addGen">加入生成</el-button>
    </div>
  </div>
</template>

<script>
import { PlayType, ScriptType } from '@/enum/enums';
import { generate } from '@/api/live/live';
export default {
  name: 'InsertAudio',
  data() {
    return {
      insertAudioContent: '',
    };
  },
  props: {

  },
  created() {
  },
  computed: {
  },
  methods: {
    /**
     * 加入生成
     */
    addGen() {
      if (!this.insertAudioContent) {
        this.$message.error("请输入需要插播的音频");
        return;
      }
      generate({
        userName: '',
        text: this.insertAudioContent,
        scriptType: ScriptType.INSERT_AUDIO.code,
        playerType: PlayType.ANCHOR.code
      }).then((res) => {
        if (res.result) {
          this.$message.success("加入生成");
        }
      });
    },
  }
};
</script>

<style lang="scss" scoped></style>
